<template>
  <div class="customerServiceImg">
    <MoreUpload
      :limit="1"
      :fileSize="10"
      :isShowTip="false"
      :isShowList="true"
      :uploadFileList="uploadFileList1"
      @successData="successUpLoadLogic1"
      ref="file"
      :fileType="fileTypeDoc"
      :file_system_url="file_system_url"
      :signature="signature"
      :paramsData="paramsData"
    />
  </div>
</template>
  
  <script>
import moreUpload from "./component/moreUpload.vue";
import axios from "axios";
export default {
  components: { moreUpload },
  data() {
    return {
      fileTypeDoc: ["doc", "docx", "jpg", "jpeg", "png", "gif", "pdf"],
      uploadFileList1: [],
      file_system_url: "",
      signature: {},
      paramsData: {},
    };
  },
  methods: {
    
    successUpLoadLogic1(e) {
      this.uploadFileList1 = e;
      console.log(e);
    },
  },
  created() {
    axios.post("https://wwwapi.icve.com.cn/project/Api/upload").then((res) => {
      if (res.data.code == 1) {
        this.file_system_url = res.data.file_system_url;
        this.signature = res.data.signature;
        this.paramsData = {
          key: this.signature.dir + "/" + this.signature.random + "/", //这里最好在后台处理好
          policy: this.signature.policy,
          OSSAccessKeyId: this.signature.accessid,
          success_action_status: "200", //让服务端返回200,不然，默认会返回204
          callback: this.signature.callback,
          signature: this.signature.signature,
          "x:space": this.signature.spaceName,
          "x:identity": this.signature.identity,
        };
      }
    });
  },
};
</script>
  
  <style lang="scss">

</style>
  